package myEasyExcelDemo;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import easyExcelTest.entity.DemoData;
import myEasyExcelDemo.impModel.EntityModel;
import org.junit.Test;

/**
 * @author changfu.he
 * @date 2021/9/6
 */
public class ImpModelExp {

    @Test
    public void test(){
        String fileName = "D:\\test.xlsx";

//        EasyExcel.write(fileName, EntityModel.class).sheet("模板").doWrite(EntityModel.initSizeModel(1000));
        ExcelWriter excelWriter = null;
        try {
            excelWriter = EasyExcel.write(fileName, EntityModel.class).build();
            WriteSheet writeSheet = EasyExcel.writerSheet("模板").build();


        } finally {
            // 千万别忘记finish 会帮忙关闭流
            if (excelWriter != null) {
                excelWriter.finish();
            }
        }



    }

}
